﻿using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System;

namespace VirtualTournaments.MatchProvider
{
	public class ShowableParticipant : PictureBox
	{
		public string participantName;
		public List<Point> participantPositions;

		public ShowableParticipant(string xParticipantName, Bitmap xParticipantImage, int xSize)
		{
			participantName = xParticipantName;
			this.Image = xParticipantImage;
			this.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
			this.BackColor = Color.Transparent;
			this.Size = new Size(xSize, xSize);
			participantPositions = new List<Point>();
		}

		public ShowableParticipant(Bitmap xParticipantImage, int xSize)
		{
			participantName = "pelota";
			this.Image = xParticipantImage;
			this.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
			this.BackColor = Color.Transparent;
			this.Size = new Size(xSize, xSize);
			participantPositions = new List<Point>();
		}

		public void addPoint(Point point)
		{
			participantPositions.Add(point);
		}

		public void setPosition(int p)
		{
			this.Invoke(() => this.Location = this.participantPositions[p]);
		}
	}
}
